package com.chinacoal.microservice;

import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import com.chinacoal.microservice.fallback.AssessmentClientFallback;
import com.chinacoal.microservice.pojo.AssessmentStatistics;
import com.chinacoal.microservice.pojo.CcmsSmartleasingAssessment;
import com.chinacoal.microservice.pojo.CcmsSmartleasingAssessmentScore;
import com.chinacoal.microservice.util.QueryCriteria;
import com.chinacoal.microservice.util.Result;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 * 考核模块-考核管理
 * @author wiilead
 *
 */
@FeignClient(name = "${spring.application.name}",fallback = AssessmentClientFallback.class,configuration = FeignAutoConfiguration.class)
@Api(tags = {"考核模块-考核管理"})
public interface AssessmentClient {
	@ApiOperation(value = "添加或修改考核")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "assesment", value = "考核实体类", required = true, dataType = "CcmsSmartleasingAssessment"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
	@PostMapping("smartleasing/assessment/addOrUpdateAssessment")
	public Result addOrUpdateAssessment(@RequestBody CcmsSmartleasingAssessment assesment,
									   @RequestHeader("token") String token);
	
	@ApiOperation(value = "查询考核列表")
    @ApiImplicitParams({
    	@ApiImplicitParam(paramType = "body", name = "queryCriteria", value = "查询条件", required = true, dataType = "QueryCriteria"),
    	@ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
	@PostMapping("smartleasing/assessment/getAssessmentList")
	public Result<List<CcmsSmartleasingAssessment>> getAssessmentList(@RequestBody QueryCriteria queryCriteria,
																	  @RequestHeader("token") String token);
	
	@ApiOperation(value = "查询考核详情")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", name = "assessmentId", value = "考核Id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
	@GetMapping("smartleasing/assessment/getAssessmentInfo/{assessmentId}")
	public Result<CcmsSmartleasingAssessment> getAssessmentInfo(@PathVariable(value = "assessmentId") String assessmentId,
																@RequestHeader("token") String token);
	
	@ApiOperation(value = "删除考核")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", name = "assessmentId", value = "考核Id", required = true, dataType = "String")
    })
	@GetMapping("smartleasing/assessment/deleteAssessmemt/{assessmentId}")
	public Result deleteAssessmemt(@PathVariable(value = "assessmentId") String assessmentId);
	
	@ApiOperation(value = "考核")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "assesmentScoreList", value = "考核得分List", required = true, dataType = "List<CcmsSmartleasingAssessment>"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
	@PostMapping("smartleasing/assessment/addAssessmentScore")
	public Result addAssessmentScore(@RequestBody List<CcmsSmartleasingAssessmentScore> assesmentScoreList,
									   @RequestHeader("token") String token);
	
	@ApiOperation(value = "查询考核统计")
    @ApiImplicitParams({
    	@ApiImplicitParam(paramType = "body", name = "queryCriteria", value = "查询条件", required = true, dataType = "QueryCriteria"),
    })
	@PostMapping("smartleasing/assessment/statisticsAssessmentList")
	public Result<List<AssessmentStatistics>> statisticsAssessmentList(@RequestBody QueryCriteria queryCriteria);
	
	@ApiOperation(value = "导出考核统计")
	@GetMapping("smartleasing/assessment/exportExcel")
	public void exportExcel(HttpServletResponse response) throws Exception;
}
